[]
dashboard.VisualNS.CommandService
• new CommandService()
▸ execute(desc
): void
执行命令。
名称 | 类型 | 描述 |
---|---|---|
desc |
ICommandDescription [] |
命令描述。 |
void
示例代码
// 运行一个命令切换容器标签
this.visualHost.commandService.execute([{
name: 'SelectTab',
payload: {
target: 'myTabContainer',
index: 0,
}
}]);
// 运行一个命令切换页面
this.visualHost.commandService.execute([{
name: 'SwitchPage',
payload: {
index: 0,
}
}]);
// 运行一个命令保留或排除数据点
this.visualHost.commandService.execute([{
name: 'Keep', // or 'Exclude'
payload: {
selectionIds,
},
}]);
// 运行一个命令跳转仪表板
this.visualHost.commandService.execute([{
name: 'Jump', // or 'Jump'
payload: {
target: '组件1',
selectionIds, //可选
position: {
x: number,
y: number
},
jumpToName,
jumpToPosition: {
top: number,
left: number
}
},
]});
// 运行一个命令钻取
this.visualHost.commandService.execute([{
name: 'Drill',
payload: {
selectionIds,
position: {
x: number,
y: number
},
drillDimension: string,
},
}]);
// 运行一个命令显示组件
this.visualHost.commandService.execute([{
name: 'ShowScenario',
payload: {
scenarioId: string;
target: string, //可选
enterAnimation: ScenarioAnimationType,
delay: number;
duration: number;
},
}]);
// 运行一个命令隐藏组件
this.visualHost.commandService.execute([{
name: 'HideScenario',
payload: {
scenarioId: string;
target: string, //可选
enterAnimation: ScenarioAnimationType,
delay: number;
duration: number;
},
}]);
// 运行一个命令切换组件
this.visualHost.commandService.execute([{
name: 'ToggleScenario',
payload: {
scenarioId: string;
target: string, //可选
enterAnimation: ScenarioAnimationType,
delay: number;
duration: number;
},
}]);